import { _decorator, AudioClip, AudioSource, Color, color, Component, Node, resources, UITransform, v3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Until')
export class Until extends Component {
    public static readonly SCREEN_W: number = 720;
    public static readonly SCREEN_H: number = 1280;
    
    /**随机生成位置 */
    public static getRandomPos() {
        let width = Until.SCREEN_W - 300;
        let height = Until.SCREEN_H - 300;
        let x = Math.round(Math.random() * width) - width / 2;
        let y = Math.round(Math.random() * height) - height / 2;
        return v3(x, y, 0);
    }
    /**随机生成颜色 */
    public static getRandomColor() {
        const red = Math.floor(Math.random() * 256)
        const green = Math.floor(Math.random() * 256)
        const blue = Math.floor(Math.random() * 256)
        return new Color(red, green, blue);
    }
    
}


